Non-volatile memories (NVMs) have been used as auxiliary storage devices or storages in recent information processing systems. Non-volatile memories are broadly divided into flash memories for data access in units of large data sizes and non-volatile random access memories (Non-volatile RAMs) to which high-speed random access is possible in units of smaller data sizes. Here, NAND flash memories are exemplified as a representative example of flash memories. On the other hand, resistive RAMs (ReRAMs), phase-change RAMs (PCRAMs), magnetoresistive RAMs (MRAMs), and the like are exemplified as examples of non-volatile random access flash memories. Among these memories, ReRAMs have attracted attention due to high access speed and the like.
Generally, in ReRAMs, a memory cell including a variable resistive element is disposed at each of intersection points of column lines and row lines which are wired in a two-dimensional lattice pattern. A driver selects a memory cell of a rewrite target on the basis of write data and applies a voltage between the column line and the row line to cause a resistance value of the selected memory cell to be changed. At this time, in ReRAM, the leakage current increases as the resistance value of the memory cell decreases. In this regard, a memory controller that encodes (inversion or the like) data so that the number of memory cells with a large resistance value does not exceed a threshold value in a case in which the number of memory cells with a large resistance value exceeds a threshold value in order to reduce power consumption has been proposed (see, for example, Patent Literature 1).